<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Image on Desktop</title>
  <meta charset="UTF-8" />
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="icon" href="https://aimonitoring.rybsj.cn/webgis/favicon.ico">
  <style>
    body {
      user-select: none;
      margin: 0;
      overflow: hidden;
      background: transparent;
      /* 背景透明 */
    }

    .close-button {
        position: absolute;
        top: 4px; /* 调整到右上角 */
        right: 4px; /* 调整到右上角 */
        background-color: white;
        color: darkred;
        padding: 0 5px;
        cursor: pointer;
        z-index: 1000; /* 确保按钮在其他元素上方 */
    }

    /* title */
    .title-bar {
      width: 100%;
      height: 40px;
      background-color: #333;
      color: white;
      display: flex;
      align-items: center;
      padding: 0 10px;
      cursor: move; /* 鼠标指针样式 */
    }
    
  </style>
</head>

<body>
  <a-button danger class="close-button" id="closeButton">×</a-button>
  <div class="title-bar">拖动窗口</div>
  <script src="renderer.js"></script>
  <script>
    document.getElementById('closeButton').addEventListener('click', () => {
      window.electron.closeApp(); // 使用暴露的函数
    });
  </script>
  <div id="app"></div>
  <script type="module" src="/src/main.js"></script>
</body>
<script>
  // let imgc = document.querySelector('.imgContainer')
  // imgc.addEventListener('click',()=>{
  //     if (!imgc.querySelector('img').getAttribute('img') || imgc.querySelector('img').getAttribute('img') == 2) {
  //         imgc.querySelector('img').src = './1.jpg'
  //         imgc.querySelector('img').setAttribute('img', 1)
  //     } else {
  //         imgc.querySelector('img').src = './2.jpg'
  //         imgc.querySelector('img').setAttribute('img', 2)
  //     }
  // })
</script>

</html>